<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>房屋信息操作</title>
    <script src="../res/js/jquery-3.4.1.min.js"></script>
    <script src="../res/layui/layui.js" charset="utf-8"></script>
    <script src="../res/js/Tools.js"></script>
    <link rel="stylesheet" href="../res/layui/css/layui.css" media="all">
    <link href="../res/echarts/eleTree.css" rel="stylesheet"/>
    <script src="../res/echarts/eleTree.js"></script>
    <script src="../res/js/login_common.js" charset="utf-8"></script>
    <style type="text/css">
        body {
            padding: 10px;
        }
        .fonts{
            line-height: 40px;
        }
    </style>

</head>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">用户名：</label>
            <div class="layui-input-inline">
                <div class="fonts" id="userName">

                </div>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">账号：</label>
            <div class="layui-input-inline">
                <div class="fonts" id="userAccount">

                </div>
            </div>
        </div>
    </div>

    <div class="layui-form-item">

        <div class="layui-inline">
            <label class="layui-form-label">手机：</label>
            <div class="layui-input-inline">
                <div class="fonts" id="userPhone">

                </div>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">身份证：</label>
            <div class="layui-input-inline">
                <div class="fonts" id="userIdentity">

                </div>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <!--<button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">修改资料</button>-->
            <input type="button" value="修改资料" id="sub" class="layui-btn">
        </div>
    </div>
</form>
<script type="text/javascript">

</script>
<script>
    var clients;

    layui.use(['form', 'layedit', 'laydate', 'layer'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        $("#demo1-getValue").on("click", function () {
            var selectArr = clients.getValue();
            console.info(selectArr);
        })

        //监听提交
        /*form.on('submit(demo1)', function (data) {
            var url = "../../userAction/addOrUpdate";

            $.post(url, data.field, function (obj) {
                if (obj.num == 1) {
                    window.parent.location.reload();//刷新父页面
                    /!*var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);*!/
                }
            }, "json")
            return false;
        });*/

        $("#sub").on("click", function () {
            layer.open({
                type: 2,
                title: '操作',
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['90%', '90%'],
                content: 'personalFrom.html'
            });
        });


        //表单取值
        layui.$('#LAY-component-form-getval').on('click', function () {
            var data = form.val('example');
            alert(JSON.stringify(data));
        });

        $("#userId").val(window.loginObj.manager.userId);
        var url = "../userAction/findById";
        var data = {"id": window.loginObj.manager.userId};
        $.post(url, data, function (obj) {
            $("#userName").html(obj.userName);             // 员工名称
            $("#userAccount").html(obj.userAccount);       // 员工账号
            $("#userPhone").html(obj.userPhone);            // 手机
            $("#userIdentity").html(obj.userIdentity);       // 身份证
            form.render();
        }, "json");

/*        $("#userName").html(window.loginObj.manager.userName);             // 员工名称
        $("#userAccount").html(window.loginObj.manager.userAccount);       // 员工账号
        $("#userPhone").html(window.loginObj.manager.userPhone);            // 手机
        $("#userIdentity").html(window.loginObj.manager.userIdentity);       // 身份证
        $("#userPassword").html(window.loginObj.manager.userPassword);           // 密码*/

        form.render();
    });
</script>
<!--
<script type="text/javascript">
    /**
     * 修改日历格式
     * @param dates
     * @returns {string}
     */
    function setDate(dates) {
        var date = new Date(dates);
        var month = date.getMonth() + 1;
        var day = date.getDate();
        var sdate = date.getFullYear() + "-"
        if (month < 10) {
            sdate += "0" + month + "-";
        } else {
            sdate += month + "-";
        }
        if (day < 10) {
            sdate += "0" + day;
        } else {
            sdate += day;
        }
        return sdate;
    }
</script>-->
</body>
</html>